﻿using System;
using System.ComponentModel;
using System.Data;
using System.Windows.Forms;
using DevExpress.Utils;
using DevExpress.XtraNavBar;
using DevExpress.XtraEditors;
using Extra.ERP;
using APP.HELPER.Utils.Language;
using DevExpress.XtraNavBar.ViewInfo;
using System.Drawing;

namespace Dictionary
{
    public class xfmDictionary : Form
    {
        private NavBarItem bbiAllowance;
        private NavBarItem bbiBranch;
        private NavBarItem bbiDegree;
        private NavBarItem bbiDepartment;
        private NavBarItem bbiEducation;
        private NavBarItem bbiEthnic;
        private NavBarItem bbiGroup;
        private NavBarItem bbiGroupRate;
        private NavBarItem bbiHoliday;
        private NavBarItem bbiInformatic;
        private NavBarItem bbiJob;
        private NavBarItem bbiLanguage;
        private NavBarItem bbiMachine;
        private NavBarItem bbiNationality;
        private NavBarItem bbiPosition;
        private NavBarItem bbiProduct;
        private NavBarItem bbiProductGroup;
        private NavBarItem bbiProfessional;
        private NavBarItem bbiRank;
        private NavBarItem bbiRate;
        private NavBarItem bbiRelative;
        private NavBarItem bbiReligion;
        private NavBarItem bbiShift;
        private NavBarItem bbiSkill;
        private NavBarItem bbiState;
        private NavBarItem bbiStep;
        private NavBarItem bbiSymbol;
        private NavBarItem bbiUnit;
        private IContainer components;
        private GroupControl gcControl;
        private ImageCollection imgClassic;
        private ImageCollection imgMetro;
        private NavBarControl navBarControl1;
        private NavBarGroup navEmployee;
        private NavBarGroup navGroupRate;
        private NavBarGroup navOrganization;
        private NavBarGroup navProduct;
        private NavBarGroup navSalary;
        private NavBarGroup navTimekeeping;
        private xucAllowance xucAllowance;
        private xucBranch xucBranch;
        private xucDegree xucDegree;
        private xucDepartment xucDepartment;
        private xucEducation xucEducation;
        private xucEthnic xucEthnic;
        private xucGroup xucGroup;
        private xucGroupRate xucGroupRate;
        private xucHoliday xucHoliday;
        private xucInformatic xucInformatic;
        private xucJob xucJob;
        private xucLanguage xucLanguage;
        private xucMachine xucMachine;
        private xucNationality xucNationality;
        private xucPosition xucPosition;
        private xucProduct xucProduct;
        private xucProductGroup xucProductGroup;
        private xucProfessional xucProfessional;
        private xucRank xucRank;
        private xucRate xucRate;
        private xucRelative xucRelative;
        private xucReligion xucReligion;
        private xucShift xucShift;
        private xucSkill xucSkill;
        private xucState xucState;
        private xucStep xucStep;
        private xucSymbol xucSymbol;
        private xucUnit xucUnit;

        public xfmDictionary()
        {
            InitializeComponent();
            InitMultiLanguages();
            base.Load += xfmDictionary_Load;
        }

        private void bbiAllowance_LinkClicked(object sender, NavBarLinkEventArgs e)
        {
            Execute("xucAllowance", "");
        }

        private void bbiBranch_LinkClicked(object sender, NavBarLinkEventArgs e)
        {
            Execute("xucBranch", "");
        }

        private void bbiDegree_LinkClicked(object sender, NavBarLinkEventArgs e)
        {
            Execute("xucDegree", "");
        }

        private void bbiDepartment_LinkClicked(object sender, NavBarLinkEventArgs e)
        {
            Execute("xucDepartment", "");
        }

        private void bbiEducation_LinkClicked(object sender, NavBarLinkEventArgs e)
        {
            Execute("xucEducation", "");
        }

        private void bbiEthnic_LinkClicked(object sender, NavBarLinkEventArgs e)
        {
            Execute("xucEthnic", "");
        }

        private void bbiGroup_LinkClicked(object sender, NavBarLinkEventArgs e)
        {
            Execute("xucGroup", "");
        }

        private void bbiGroupRate_LinkClicked(object sender, NavBarLinkEventArgs e)
        {
            Execute("xucGroupRate", "");
        }

        private void bbiHoliday_LinkClicked(object sender, NavBarLinkEventArgs e)
        {
            Execute("xucHoliday", "");
        }

        private void bbiInformatic_LinkClicked(object sender, NavBarLinkEventArgs e)
        {
            Execute("xucInformatic", "");
        }

        private void bbiJob_LinkClicked(object sender, NavBarLinkEventArgs e)
        {
            Execute("xucJob", "");
        }

        private void bbiLanguage_LinkClicked(object sender, NavBarLinkEventArgs e)
        {
            Execute("xucLanguage", "");
        }

        private void bbiMachine_LinkClicked(object sender, NavBarLinkEventArgs e)
        {
            Execute("xucMachine", "");
        }

        private void bbiNationality_LinkClicked(object sender, NavBarLinkEventArgs e)
        {
            Execute("xucNationality", "");
        }

        private void bbiPosition_LinkClicked(object sender, NavBarLinkEventArgs e)
        {
            Execute("xucPosition", "");
        }

        private void bbiProduct_LinkClicked(object sender, NavBarLinkEventArgs e)
        {
            Execute("xucProduct", "");
        }

        private void bbiProductGroup_LinkClicked(object sender, NavBarLinkEventArgs e)
        {
            Execute("xucProductGroup", "");
        }

        private void bbiProfessional_LinkClicked(object sender, NavBarLinkEventArgs e)
        {
            Execute("xucProfessional", "");
        }

        private void bbiRank_LinkClicked(object sender, NavBarLinkEventArgs e)
        {
            Execute("xucRank", "");
        }

        private void bbiRate_LinkClicked(object sender, NavBarLinkEventArgs e)
        {
            Execute("xucRate", "");
        }

        private void bbiRelative_LinkClicked(object sender, NavBarLinkEventArgs e)
        {
            Execute("xucRelative", "");
        }

        private void bbiReligion_LinkClicked(object sender, NavBarLinkEventArgs e)
        {
            Execute("xucReligion", "");
        }

        private void bbiShift_LinkClicked(object sender, NavBarLinkEventArgs e)
        {
            Execute("xucShift", "");
        }

        private void bbiSkill_LinkClicked(object sender, NavBarLinkEventArgs e)
        {
            Execute("xucSkill", "");
        }

        private void bbiState_LinkClicked(object sender, NavBarLinkEventArgs e)
        {
            Execute("xucState", "");
        }

        private void bbiStep_LinkClicked(object sender, NavBarLinkEventArgs e)
        {
            Execute("xucStep", "");
        }

        private void bbiSymbol_LinkClicked(object sender, NavBarLinkEventArgs e)
        {
            Execute("xucSymbol", "");
        }

        private void bbiUnit_LinkClicked(object sender, NavBarLinkEventArgs e)
        {
            Execute("xucUnit", "");
        }

        protected override void Dispose(bool disposing)
        {
            if (disposing && (components != null))
            {
                components.Dispose();
            }
            base.Dispose(disposing);
        }

        private void Execute(string id, string @ref)
        {
            switch (id)
            {
                case "xucLanguage":
                    SYS_LOG.Insert("Danh Mục Ngoại Ngữ", "Xem");
                    gcControl.Text = bbiLanguage.Caption;
                    if (xucLanguage != null)
                    {
                        xucLanguage.BringToFront();
                        break;
                    }
                    xucLanguage = new xucLanguage();
                    xucLanguage.Dock = DockStyle.Fill;
                    gcControl.Controls.Add(xucLanguage);
                    xucLanguage.BringToFront();
                    break;

                case "xucProfessional":
                    SYS_LOG.Insert("Danh Mục Chuy\x00ean M\x00f4n", "Xem");
                    gcControl.Text = bbiProfessional.Caption;
                    if (xucProfessional != null)
                    {
                        xucProfessional.BringToFront();
                        break;
                    }
                    xucProfessional = new xucProfessional();
                    xucProfessional.Dock = DockStyle.Fill;
                    gcControl.Controls.Add(xucProfessional);
                    xucProfessional.BringToFront();
                    break;

                case "xucDegree":
                    SYS_LOG.Insert("Danh Mục Bằng Cấp", "Xem");
                    gcControl.Text = bbiDegree.Caption;
                    if (xucDegree != null)
                    {
                        xucDegree.BringToFront();
                        break;
                    }
                    xucDegree = new xucDegree();
                    xucDegree.Dock = DockStyle.Fill;
                    gcControl.Controls.Add(xucDegree);
                    xucDegree.BringToFront();
                    break;

                case "xucJob":
                    SYS_LOG.Insert("Danh Mục C\x00f4ng Việc", "Xem");
                    gcControl.Text = bbiJob.Caption;
                    if (xucJob != null)
                    {
                        xucJob.BringToFront();
                        break;
                    }
                    xucJob = new xucJob();
                    xucJob.Dock = DockStyle.Fill;
                    gcControl.Controls.Add(xucJob);
                    xucJob.BringToFront();
                    break;

                case "xucNationality":
                    SYS_LOG.Insert("Danh Mục Quốc Tịch", "Xem");
                    gcControl.Text = bbiNationality.Caption;
                    if (xucNationality != null)
                    {
                        xucNationality.BringToFront();
                        break;
                    }
                    xucNationality = new xucNationality();
                    xucNationality.Dock = DockStyle.Fill;
                    gcControl.Controls.Add(xucNationality);
                    xucNationality.BringToFront();
                    break;

                case "xucEthnic":
                    SYS_LOG.Insert("Danh Mục D\x00e2n Tộc", "Xem");
                    gcControl.Text = bbiEthnic.Caption;
                    if (xucEthnic != null)
                    {
                        xucEthnic.BringToFront();
                        break;
                    }
                    xucEthnic = new xucEthnic();
                    xucEthnic.Dock = DockStyle.Fill;
                    gcControl.Controls.Add(xucEthnic);
                    xucEthnic.BringToFront();
                    break;

                case "xucReligion":
                    SYS_LOG.Insert("Danh Mục T\x00f4n Gi\x00e1o", "Xem");
                    gcControl.Text = bbiReligion.Caption;
                    if (xucReligion != null)
                    {
                        xucReligion.BringToFront();
                        break;
                    }
                    xucReligion = new xucReligion();
                    xucReligion.Dock = DockStyle.Fill;
                    gcControl.Controls.Add(xucReligion);
                    xucReligion.BringToFront();
                    break;

                case "xucRelative":
                    SYS_LOG.Insert("Danh Mục Quan Hệ Gia Đ\x00ecnh", "Xem");
                    gcControl.Text = bbiRelative.Caption;
                    if (xucRelative != null)
                    {
                        xucRelative.BringToFront();
                        break;
                    }
                    xucRelative = new xucRelative();
                    xucRelative.Dock = DockStyle.Fill;
                    gcControl.Controls.Add(xucRelative);
                    xucRelative.BringToFront();
                    break;

                case "xucEducation":
                    SYS_LOG.Insert("Danh Mục Học Vấn", "Xem");
                    gcControl.Text = bbiEducation.Caption;
                    if (xucEducation != null)
                    {
                        xucEducation.BringToFront();
                        break;
                    }
                    xucEducation = new xucEducation();
                    xucEducation.Dock = DockStyle.Fill;
                    gcControl.Controls.Add(xucEducation);
                    xucEducation.BringToFront();
                    break;

                case "xucInformatic":
                    SYS_LOG.Insert("Danh Mục Tin Học", "Xem");
                    gcControl.Text = bbiInformatic.Caption;
                    if (xucInformatic != null)
                    {
                        xucInformatic.BringToFront();
                        break;
                    }
                    xucInformatic = new xucInformatic();
                    xucInformatic.Dock = DockStyle.Fill;
                    gcControl.Controls.Add(xucInformatic);
                    xucInformatic.BringToFront();
                    break;

                case "xucPosition":
                    SYS_LOG.Insert("Danh Mục Chức Vụ", "Xem");
                    gcControl.Text = bbiPosition.Caption;
                    if (xucPosition != null)
                    {
                        xucPosition.BringToFront();
                        break;
                    }
                    xucPosition = new xucPosition();
                    xucPosition.Dock = DockStyle.Fill;
                    gcControl.Controls.Add(xucPosition);
                    xucPosition.BringToFront();
                    break;

                case "xucSkill":
                    SYS_LOG.Insert("Danh Mục Kỹ Năng", "Xem");
                    gcControl.Text = bbiSkill.Caption;
                    if (xucSkill != null)
                    {
                        xucSkill.BringToFront();
                        break;
                    }
                    xucSkill = new xucSkill();
                    xucSkill.Dock = DockStyle.Fill;
                    gcControl.Controls.Add(xucSkill);
                    xucSkill.BringToFront();
                    break;

                case "xucRate":
                    SYS_LOG.Insert("Danh Mục Ti\x00eau Ch\x00ed Đ\x00e1nh Gi\x00e1", "Xem");
                    gcControl.Text = bbiRate.Caption;
                    if (xucRate != null)
                    {
                        xucRate.BringToFront();
                        break;
                    }
                    xucRate = new xucRate();
                    xucRate.Dock = DockStyle.Fill;
                    gcControl.Controls.Add(xucRate);
                    xucRate.BringToFront();
                    break;

                case "xucGroupRate":
                    SYS_LOG.Insert("Danh Mục Ti\x00eau Ch\x00ed Đ\x00e1nh Gi\x00e1", "Xem");
                    gcControl.Text = bbiGroupRate.Caption;
                    if (xucGroupRate != null)
                    {
                        xucGroupRate.BringToFront();
                        break;
                    }
                    xucGroupRate = new xucGroupRate();
                    xucGroupRate.Dock = DockStyle.Fill;
                    gcControl.Controls.Add(xucGroupRate);
                    xucGroupRate.BringToFront();
                    break;

                case "xucBranch":
                    SYS_LOG.Insert("Chi Nh\x00e1nh C\x00f4ng Ty", "Xem");
                    gcControl.Text = bbiBranch.Caption;
                    if (xucBranch != null)
                    {
                        xucBranch.BringToFront();
                        break;
                    }
                    xucBranch = new xucBranch();
                    xucBranch.Dock = DockStyle.Fill;
                    gcControl.Controls.Add(xucBranch);
                    xucBranch.BringToFront();
                    break;

                case "xucDepartment":
                    SYS_LOG.Insert("Danh S\x00e1ch Ph\x00f2ng Ban", "Xem");
                    gcControl.Text = bbiDepartment.Caption;
                    if (xucDepartment != null)
                    {
                        xucDepartment.BringToFront();
                        break;
                    }
                    xucDepartment = new xucDepartment();
                    xucDepartment.Dock = DockStyle.Fill;
                    gcControl.Controls.Add(xucDepartment);
                    xucDepartment.BringToFront();
                    break;

                case "xucGroup":
                    SYS_LOG.Insert("C\x00e1c Tổ, Nh\x00f3m", "Xem");
                    gcControl.Text = bbiGroup.Caption;
                    if (xucGroup != null)
                    {
                        xucGroup.BringToFront();
                        break;
                    }
                    xucGroup = new xucGroup();
                    xucGroup.Dock = DockStyle.Fill;
                    gcControl.Controls.Add(xucGroup);
                    xucGroup.BringToFront();
                    break;

                case "xucShift":
                    SYS_LOG.Insert("Ca L\x00e0m Việc", "Xem");
                    gcControl.Text = bbiShift.Caption;
                    if (xucShift != null)
                    {
                        xucShift.BringToFront();
                        break;
                    }
                    xucShift = new xucShift();
                    xucShift.Dock = DockStyle.Fill;
                    gcControl.Controls.Add(xucShift);
                    xucShift.BringToFront();
                    break;

                case "xucSymbol":
                    SYS_LOG.Insert("K\x00fd Hiệu Chấm C\x00f4ng", "Xem");
                    gcControl.Text = bbiSymbol.Caption;
                    if (xucSymbol != null)
                    {
                        xucSymbol.BringToFront();
                        break;
                    }
                    xucSymbol = new xucSymbol();
                    xucSymbol.Dock = DockStyle.Fill;
                    gcControl.Controls.Add(xucSymbol);
                    xucSymbol.BringToFront();
                    break;

                case "xucMachine":
                    SYS_LOG.Insert("Danh S\x00e1ch Thiết Bị", "Xem");
                    gcControl.Text = bbiMachine.Caption;
                    if (xucMachine != null)
                    {
                        xucMachine.BringToFront();
                        break;
                    }
                    xucMachine = new xucMachine();
                    xucMachine.Dock = DockStyle.Fill;
                    gcControl.Controls.Add(xucMachine);
                    xucMachine.BringToFront();
                    break;

                case "xucHoliday":
                    SYS_LOG.Insert("Ng\x00e0y Nghỉ, Ng\x00e0y Lễ", "Xem");
                    gcControl.Text = bbiHoliday.Caption;
                    if (xucHoliday != null)
                    {
                        xucHoliday.BringToFront();
                        break;
                    }
                    xucHoliday = new xucHoliday();
                    xucHoliday.Dock = DockStyle.Fill;
                    gcControl.Controls.Add(xucHoliday);
                    xucHoliday.BringToFront();
                    break;

                case "xucUnit":
                    SYS_LOG.Insert("Đơn Vị T\x00ednh", "Xem");
                    gcControl.Text = bbiUnit.Caption;
                    if (xucUnit != null)
                    {
                        xucUnit.BringToFront();
                        break;
                    }
                    xucUnit = new xucUnit();
                    xucUnit.Dock = DockStyle.Fill;
                    gcControl.Controls.Add(xucUnit);
                    xucUnit.BringToFront();
                    break;

                case "xucProductGroup":
                    SYS_LOG.Insert("Nh\x00f3m Sản Phẩm", "Xem");
                    gcControl.Text = bbiProductGroup.Caption;
                    if (xucProductGroup != null)
                    {
                        xucProductGroup.BringToFront();
                        break;
                    }
                    xucProductGroup = new xucProductGroup();
                    xucProductGroup.Dock = DockStyle.Fill;
                    gcControl.Controls.Add(xucProductGroup);
                    xucProductGroup.BringToFront();
                    break;

                case "xucProduct":
                    SYS_LOG.Insert("Sản Phẩm", "Xem");
                    gcControl.Text = bbiProduct.Caption;
                    if (xucProduct != null)
                    {
                        xucProduct.BringToFront();
                        break;
                    }
                    xucProduct = new xucProduct();
                    xucProduct.Dock = DockStyle.Fill;
                    gcControl.Controls.Add(xucProduct);
                    xucProduct.BringToFront();
                    break;

                case "xucState":
                    SYS_LOG.Insert("C\x00f4ng Đoạn", "Xem");
                    gcControl.Text = bbiState.Caption;
                    if (xucState != null)
                    {
                        xucState.BringToFront();
                        break;
                    }
                    xucState = new xucState();
                    xucState.Dock = DockStyle.Fill;
                    gcControl.Controls.Add(xucState);
                    xucState.BringToFront();
                    break;

                case "xucRank":
                    SYS_LOG.Insert("Ngạch Lương", "Xem");
                    gcControl.Text = bbiRank.Caption;
                    if (xucRank != null)
                    {
                        xucRank.BringToFront();
                        break;
                    }
                    xucRank = new xucRank();
                    xucRank.Dock = DockStyle.Fill;
                    gcControl.Controls.Add(xucRank);
                    xucRank.BringToFront();
                    break;

                case "xucStep":
                    SYS_LOG.Insert("Bậc Lương", "Xem");
                    gcControl.Text = bbiStep.Caption;
                    if (xucStep != null)
                    {
                        xucStep.BringToFront();
                        break;
                    }
                    xucStep = new xucStep();
                    xucStep.Dock = DockStyle.Fill;
                    gcControl.Controls.Add(xucStep);
                    xucStep.BringToFront();
                    break;

                case "xucAllowance":
                    SYS_LOG.Insert("Phụ Cấp", "Xem");
                    gcControl.Text = bbiAllowance.Caption;
                    if (xucAllowance != null)
                    {
                        xucAllowance.BringToFront();
                        break;
                    }
                    xucAllowance = new xucAllowance();
                    xucAllowance.Dock = DockStyle.Fill;
                    gcControl.Controls.Add(xucAllowance);
                    xucAllowance.BringToFront();
                    break;
            }
        }

        private void InitializeComponent()
        {
            components = new Container();
            var manager = new ComponentResourceManager(typeof (xfmDictionary));
            navBarControl1 = new NavBarControl();
            navEmployee = new NavBarGroup();
            bbiPosition = new NavBarItem();
            bbiProfessional = new NavBarItem();
            bbiDegree = new NavBarItem();
            bbiJob = new NavBarItem();
            bbiNationality = new NavBarItem();
            bbiEthnic = new NavBarItem();
            bbiReligion = new NavBarItem();
            bbiRelative = new NavBarItem();
            bbiEducation = new NavBarItem();
            bbiLanguage = new NavBarItem();
            bbiInformatic = new NavBarItem();
            bbiSkill = new NavBarItem();
            navOrganization = new NavBarGroup();
            bbiBranch = new NavBarItem();
            bbiDepartment = new NavBarItem();
            bbiGroup = new NavBarItem();
            navTimekeeping = new NavBarGroup();
            bbiShift = new NavBarItem();
            bbiSymbol = new NavBarItem();
            bbiMachine = new NavBarItem();
            bbiHoliday = new NavBarItem();
            navProduct = new NavBarGroup();
            bbiUnit = new NavBarItem();
            bbiState = new NavBarItem();
            bbiProductGroup = new NavBarItem();
            bbiProduct = new NavBarItem();
            navSalary = new NavBarGroup();
            bbiRank = new NavBarItem();
            bbiStep = new NavBarItem();
            bbiAllowance = new NavBarItem();
            navGroupRate = new NavBarGroup();
            bbiGroupRate = new NavBarItem();
            bbiRate = new NavBarItem();
            imgClassic = new ImageCollection(components);
            imgMetro = new ImageCollection(components);
            gcControl = new GroupControl();
            navBarControl1.BeginInit();
            imgClassic.BeginInit();
            imgMetro.BeginInit();
            gcControl.BeginInit();
            base.SuspendLayout();
            navBarControl1.ActiveGroup = navEmployee;
            navBarControl1.ContentButtonHint = null;
            navBarControl1.Dock = DockStyle.Left;
            navBarControl1.Groups
                .AddRange(new NavBarGroup[]
                {navEmployee, navOrganization, navTimekeeping, navProduct, navSalary, navGroupRate});
            navBarControl1.Items.AddRange(new NavBarItem[]
            {
                bbiPosition, bbiProfessional, bbiEthnic, bbiEducation, bbiLanguage, bbiNationality, bbiInformatic,
                bbiReligion, bbiJob, bbiShift, bbiDegree, bbiRelative, bbiRank, bbiStep, bbiBranch, bbiDepartment,
                bbiGroup, bbiAllowance, bbiSymbol, bbiMachine, bbiSkill, bbiRate, bbiGroupRate, bbiUnit, bbiProductGroup,
                bbiProduct, bbiState, bbiHoliday
            });
            navBarControl1.Location = new Point(0, 0);
            navBarControl1.Name = "navBarControl1";
            navBarControl1.NavigationPaneMaxVisibleGroups= 5;
            navBarControl1.OptionsNavPane.ExpandedWidth = 190;
            navBarControl1.Size = new Size(190, 0x274);
            navBarControl1.SmallImages = imgClassic;
            navBarControl1.TabIndex = 3;
            navBarControl1.Text = "navBarControl1";
            navBarControl1.View = new SkinNavigationPaneViewInfoRegistrator();
            navEmployee.Caption = "Danh Mục Nh\x00e2n Sự";
            navEmployee.Expanded = true;
            navEmployee.ItemLinks
                .AddRange(new NavBarItemLink[]
                {
                    new NavBarItemLink(bbiPosition), new NavBarItemLink(bbiProfessional), new NavBarItemLink(bbiDegree),
                    new NavBarItemLink(bbiJob), new NavBarItemLink(bbiNationality), new NavBarItemLink(bbiEthnic),
                    new NavBarItemLink(bbiReligion), new NavBarItemLink(bbiRelative), new NavBarItemLink(bbiEducation),
                    new NavBarItemLink(bbiLanguage), new NavBarItemLink(bbiInformatic), new NavBarItemLink(bbiSkill)
                });
            navEmployee.Name = "navEmployee";
            navEmployee.SmallImageIndex = 0;
            navEmployee.TopVisibleLinkIndex = 5;
            bbiPosition.Caption = "Chức Vụ";
            bbiPosition.Name = "bbiPosition";
            bbiPosition.SmallImageIndex = 4;
            bbiPosition.LinkClicked += new NavBarLinkEventHandler(bbiPosition_LinkClicked);
            bbiProfessional.Caption = "Chuy\x00ean M\x00f4n";
            bbiProfessional.Name = "bbiProfessional";
            bbiProfessional.SmallImageIndex = 5;
            bbiProfessional.LinkClicked += new NavBarLinkEventHandler(bbiProfessional_LinkClicked);
            bbiDegree.Caption = "Bằng cấp";
            bbiDegree.Name = "bbiDegree";
            bbiDegree.SmallImageIndex = 6;
            bbiDegree.LinkClicked += new NavBarLinkEventHandler(bbiDegree_LinkClicked);
            bbiJob.Caption = "C\x00f4ng Việc";
            bbiJob.Name = "bbiJob";
            bbiJob.SmallImageIndex = 7;
            bbiJob.LinkClicked += new NavBarLinkEventHandler(bbiJob_LinkClicked);
            bbiNationality.Caption = "Quốc Tịch";
            bbiNationality.Name = "bbiNationality";
            bbiNationality.SmallImageIndex = 8;
            bbiNationality.LinkClicked += new NavBarLinkEventHandler(bbiNationality_LinkClicked);
            bbiEthnic.Caption = "D\x00e2n Tộc";
            bbiEthnic.Name = "bbiEthnic";
            bbiEthnic.SmallImageIndex = 9;
            bbiEthnic.LinkClicked += new NavBarLinkEventHandler(bbiEthnic_LinkClicked);
            bbiReligion.Caption = "T\x00f4n Gi\x00e1o";
            bbiReligion.Name = "bbiReligion";
            bbiReligion.SmallImageIndex = 10;
            bbiReligion.LinkClicked += new NavBarLinkEventHandler(bbiReligion_LinkClicked);
            bbiRelative.Caption = "Quan Hệ Gia Đ\x00ecnh";
            bbiRelative.Name = "bbiRelative";
            bbiRelative.SmallImageIndex = 11;
            bbiRelative.LinkClicked += new NavBarLinkEventHandler(bbiRelative_LinkClicked);
            bbiEducation.Caption = "Học Vấn";
            bbiEducation.Name = "bbiEducation";
            bbiEducation.SmallImageIndex = 12;
            bbiEducation.LinkClicked += new NavBarLinkEventHandler(bbiEducation_LinkClicked);
            bbiLanguage.Caption = "Ngoại Ngữ";
            bbiLanguage.Name = "bbiLanguage";
            bbiLanguage.SmallImageIndex = 13;
            bbiLanguage.LinkClicked += new NavBarLinkEventHandler(bbiLanguage_LinkClicked);
            bbiInformatic.Caption = "Tin Học";
            bbiInformatic.Name = "bbiInformatic";
            bbiInformatic.SmallImageIndex=14;
            bbiInformatic.LinkClicked +=new NavBarLinkEventHandler( bbiInformatic_LinkClicked);
            bbiSkill.Caption = "Kỹ Năng";
            bbiSkill.Name ="bbiSkill";
            bbiSkill.SmallImageIndex =4;
            bbiSkill.LinkClicked +=new NavBarLinkEventHandler( bbiSkill_LinkClicked);
            navOrganization.Caption = "Cơ Cấu Tổ Chức";
            navOrganization.ItemLinks
                .AddRange(new NavBarItemLink[]
                {new NavBarItemLink(bbiBranch), new NavBarItemLink(bbiDepartment), new NavBarItemLink(bbiGroup)});
            navOrganization.Name ="navOrganization";
            navOrganization.SmallImageIndex =1;
            bbiBranch.Caption = "Chi Nh\x00e1nh C\x00f4ng Ty";
            bbiBranch.Name ="bbiBranch";
            bbiBranch.SmallImageIndex = 15;
            bbiBranch.LinkClicked +=new NavBarLinkEventHandler( bbiBranch_LinkClicked);
            bbiDepartment.Caption = "Danh S\x00e1ch Ph\x00f2ng Ban";
            bbiDepartment.Name="bbiDepartment";
            bbiDepartment.SmallImageIndex=0x10;
            bbiDepartment.LinkClicked +=new NavBarLinkEventHandler( bbiDepartment_LinkClicked);
            bbiGroup.Caption = "C\x00e1c Tổ, Nh\x00f3m";
            bbiGroup.Name="bbiGroup";
            bbiGroup.SmallImageIndex=0x1;
            bbiGroup.LinkClicked +=new NavBarLinkEventHandler( bbiGroup_LinkClicked);
            navTimekeeping.Caption = "Danh Mục Chấm C\x00f4ng";
            navTimekeeping.ItemLinks
                .AddRange(new NavBarItemLink[]
                {
                    new NavBarItemLink(bbiShift), new NavBarItemLink(bbiSymbol), new NavBarItemLink(bbiMachine),
                    new NavBarItemLink(bbiHoliday)
                });
            navTimekeeping.Name = "navTimekeeping";
            navTimekeeping.SmallImageIndex = 2;
            bbiShift.Caption = "Ca L\x00e0m Việc";
            bbiShift.Name = "bbiShift";
            bbiShift.SmallImageIndex = 0x12;
            bbiShift.LinkClicked +=new NavBarLinkEventHandler( bbiShift_LinkClicked);
            bbiSymbol.Caption = "K\x00fd Hiệu Chấm C\x00f4ng";
            bbiSymbol.Name = "bbiSymbol";
            bbiSymbol.SmallImageIndex = 0x13;
            bbiSymbol.LinkClicked +=new NavBarLinkEventHandler( bbiSymbol_LinkClicked);
            bbiMachine.Caption = "Danh S\x00e1ch Thiết Bị";
            bbiMachine.Name = "bbiMachine";
            bbiMachine.SmallImageIndex = 20;
            bbiMachine.LinkClicked +=new NavBarLinkEventHandler( bbiMachine_LinkClicked);
            bbiHoliday.Caption = "Ng\x00e0y Nghỉ, Ng\x00e0y Lễ";
            bbiHoliday.Name = "bbiHoliday";
            bbiHoliday.SmallImageIndex = 0x15;
            bbiHoliday.LinkClicked +=new NavBarLinkEventHandler( bbiHoliday_LinkClicked);
            navProduct.Caption = "Danh Mục Sản Phẩm";
            navProduct.ItemLinks
                .AddRange(new NavBarItemLink[]
                {
                    new NavBarItemLink(bbiUnit), new NavBarItemLink(bbiState), new NavBarItemLink(bbiProductGroup),
                    new NavBarItemLink(bbiProduct)
                });
            navProduct.Name = "navProduct";
            navProduct.SmallImageIndex = 0x1a;
            navProduct.Visible = false;
            bbiUnit.Caption = "Đơn Vị T\x00ednh";
            bbiUnit.Name = "bbiUnit";
            bbiUnit.SmallImageIndex = 0x1b;
            bbiUnit.LinkClicked +=new NavBarLinkEventHandler( bbiUnit_LinkClicked);
            bbiState.Caption = "C\x00f4ng Đoạn Sản Xuất";
            bbiState.Name = "bbiState";
            bbiState.SmallImageIndex = 30;
            bbiState.LinkClicked +=new NavBarLinkEventHandler( bbiState_LinkClicked);
            bbiProductGroup.Caption = "Nh\x00f3m Sản Phẩm";
            bbiProductGroup.Name ="bbiProductGroup";
            bbiProductGroup.SmallImageIndex =0x1c;
            bbiProductGroup.LinkClicked +=new NavBarLinkEventHandler( bbiProductGroup_LinkClicked);
            bbiProduct.Caption = "Sản Phẩm";
            bbiProduct.Name ="bbiProduct";
            bbiProduct.SmallImageIndex =0x1d;
            bbiProduct.LinkClicked +=new NavBarLinkEventHandler( bbiProduct_LinkClicked);
            navSalary.Caption = "Danh Mục T\x00ednh Lương";
            navSalary.ItemLinks
                .AddRange(new NavBarItemLink[]
                {new NavBarItemLink(bbiRank), new NavBarItemLink(bbiStep), new NavBarItemLink(bbiAllowance)});
            navSalary.LargeImageIndex =0x44;
            navSalary.Name ="navSalary";
            navSalary.SmallImageIndex =3;
            bbiRank.Caption = "Ngạch Lương";
            bbiRank.LargeImageIndex =0x42;
            bbiRank.Name ="bbiRank";
            bbiRank.SmallImageIndex =0x16;
            bbiRank.LinkClicked +=new NavBarLinkEventHandler( bbiRank_LinkClicked);
            bbiStep.Caption = "Bậc Lương";
            bbiStep.LargeImageIndex =0x43;
            bbiStep.Name ="bbiStep";
            bbiStep.SmallImageIndex =0x17;
            bbiStep.LinkClicked +=new NavBarLinkEventHandler( bbiStep_LinkClicked);
            bbiAllowance.Caption = "Phụ Cấp";
            bbiAllowance.Name ="bbiAllowance";
            bbiAllowance.SmallImageIndex =0x18;
            bbiAllowance.LinkClicked +=new NavBarLinkEventHandler( bbiAllowance_LinkClicked);
            navGroupRate.Caption = "Ti\x00eau Ch\x00ed Đ\x00e1nh Gi\x00e1";
            navGroupRate.ItemLinks
                .AddRange(new NavBarItemLink[] {new NavBarItemLink(bbiGroupRate), new NavBarItemLink(bbiRate)});
            navGroupRate.Name ="navGroupRate";
            navGroupRate.SmallImageIndex =0x19;
            bbiGroupRate.Caption = "Nh\x00f3m Ti\x00eau Ch\x00ed";
            bbiGroupRate.Name ="bbiGroupRate";
            bbiGroupRate.SmallImageIndex =14;
            bbiGroupRate.LinkClicked +=new NavBarLinkEventHandler( bbiGroupRate_LinkClicked);
            bbiRate.Caption = "Ti\x00eau Ch\x00ed Đ\x00e1nh Gi\x00e1";
            bbiRate.Name ="bbiRate";
            bbiRate.SmallImageIndex =14;
            bbiRate.LinkClicked +=new NavBarLinkEventHandler( bbiRate_LinkClicked);
            imgClassic.ImageSize = new Size(0x20, 0x20);
            imgClassic.ImageStream = (ImageCollectionStreamer) manager.GetObject("imgClassic.ImageStream");
            imgClassic.Images.SetKeyName(0, "bbiEmployee.png");
            imgClassic.Images.SetKeyName(1, "bbiOrganization.png");
            imgClassic.Images.SetKeyName(2, "bbiTimekeeping.png");
            imgClassic.Images.SetKeyName(3, "bbiSalary.png");
            imgClassic.Images.SetKeyName(4, "bbiPosition.png");
            imgClassic.Images.SetKeyName(5, "bbiProfessional.png");
            imgClassic.Images.SetKeyName(6, "bbiDegree.png");
            imgClassic.Images.SetKeyName(7, "bbiJob.png");
            imgClassic.Images.SetKeyName(8, "bbiNationality.png");
            imgClassic.Images.SetKeyName(9, "bbiEthnic.png");
            imgClassic.Images.SetKeyName(10, "bbiReligion.png");
            imgClassic.Images.SetKeyName(11, "bbiRelative.png");
            imgClassic.Images.SetKeyName(12, "bbiEducation.png");
            imgClassic.Images.SetKeyName(13, "bbiLanguage.png");
            imgClassic.Images.SetKeyName(14, "bbiInformatic.png");
            imgClassic.Images.SetKeyName(15, "bbiBranch.png");
            imgClassic.Images.SetKeyName(0x10, "bbiDepartment.png");
            imgClassic.Images.SetKeyName(0x11, "bbiGroup.png");
            imgClassic.Images.SetKeyName(0x12, "bbiShift.png");
            imgClassic.Images.SetKeyName(0x13, "bbiSymbol.png");
            imgClassic.Images.SetKeyName(20, "bbiMachine.png");
            imgClassic.Images.SetKeyName(0x15, "bbiHoliday.png");
            imgClassic.Images.SetKeyName(0x16, "bbiRank.png");
            imgClassic.Images.SetKeyName(0x17, "bbiStep.png");
            imgClassic.Images.SetKeyName(0x18, "bbiAllowance.png");
            imgClassic.Images.SetKeyName(0x19, "bbiGroupRate.png");
            imgClassic.Images.SetKeyName(0x1a, "bbiProduct.png");
            imgClassic.Images.SetKeyName(0x1b, "bbiProductUnit.png");
            imgClassic.Images.SetKeyName(0x1c, "bbiProductGroup.png");
            imgClassic.Images.SetKeyName(0x1d, "bbiProduct1.png");
            imgClassic.Images.SetKeyName(30, "bbiProductStage.png");
            imgMetro.ImageSize = new Size(0x20, 0x20);
            imgMetro.ImageStream = (ImageCollectionStreamer) manager.GetObject("imgMetro.ImageStream");
            imgMetro.Images.SetKeyName(0, "bbiEmployee.png");
            imgMetro.Images.SetKeyName(1, "bbiOrganization.png");
            imgMetro.Images.SetKeyName(2, "bbiTimekeeping.png");
            imgMetro.Images.SetKeyName(3, "bbiSalary.png");
            imgMetro.Images.SetKeyName(4, "bbiPosition.png");
            imgMetro.Images.SetKeyName(5, "bbiProfessional.png");
            imgMetro.Images.SetKeyName(6, "bbiDegree.png");
            imgMetro.Images.SetKeyName(7, "bbiJob.png");
            imgMetro.Images.SetKeyName(8, "bbiNationality.png");
            imgMetro.Images.SetKeyName(9, "bbiEthnic.png");
            imgMetro.Images.SetKeyName(10, "bbiReligion.png");
            imgMetro.Images.SetKeyName(11, "bbiRelative.png");
            imgMetro.Images.SetKeyName(12, "bbiEducation.png");
            imgMetro.Images.SetKeyName(13, "bbiLanguage.png");
            imgMetro.Images.SetKeyName(14, "bbiInformatic.png");
            imgMetro.Images.SetKeyName(15, "bbiBranch.png");
            imgMetro.Images.SetKeyName(0x10, "bbiDepartment.png");
            imgMetro.Images.SetKeyName(0x11, "bbiGroup.png");
            imgMetro.Images.SetKeyName(0x12, "bbiShift.png");
            imgMetro.Images.SetKeyName(0x13, "bbiSymbol.png");
            imgMetro.Images.SetKeyName(20, "bbiMachine.png");
            imgMetro.Images.SetKeyName(0x15, "bbiHoliday.png");
            imgMetro.Images.SetKeyName(0x16, "bbiRank.png");
            imgMetro.Images.SetKeyName(0x17, "bbiStep.png");
            imgMetro.Images.SetKeyName(0x18, "bbiAllowance.png");
            imgMetro.Images.SetKeyName(0x19, "bbiGroupRate.png");
            imgMetro.Images.SetKeyName(0x1a, "bbiProduct.png");
            imgMetro.Images.SetKeyName(0x1b, "bbiUnit.png");
            imgMetro.Images.SetKeyName(0x1c, "bbiProductGroup.png");
            imgMetro.Images.SetKeyName(0x1d, "bbiProduct1.png");
            imgMetro.Images.SetKeyName(30, "bbiProductStage.png");
            gcControl.Dock = DockStyle.Fill;
            gcControl.Location = new Point(190, 0);
            gcControl.Name = "gcControl";
            gcControl.Size = new Size(0x2ca, 0x274);
            gcControl.TabIndex = 4;
            gcControl.Text = "groupControl1";
            base.AutoScaleDimensions = new SizeF(6f, 13f);
            base.AutoScaleMode = AutoScaleMode.Font;
            base.ClientSize = new Size(0x388, 0x274);
            base.Controls.Add(gcControl);
            base.Controls.Add(navBarControl1);
            base.Name = "xfmDictionary";
            Text = "Danh Mục Chương Tr\x00ecnh";
            base.Load += xfmDictionary_Load_1;
            navBarControl1.EndInit();
            imgClassic.EndInit();
            imgMetro.EndInit();
            gcControl.EndInit();
            base.ResumeLayout(false);
        }

        private void InitMultiLanguages()
        {
            Text = MultiLanguages.GetString("tbl_Dictionary", "Dictionary", Text);
            navEmployee.Caption = MultiLanguages.GetString("tbl_Dictionary", "DictionaryOfPersonnel",
                navEmployee.Caption);
            navOrganization.Caption = MultiLanguages.GetString("tbl_Dictionary", "OrganizationalStructure",
                navOrganization.Caption);
            navTimekeeping.Caption = MultiLanguages.GetString("tbl_Dictionary", "DictionaryOfTimekeeping",
                navTimekeeping.Caption);
            navSalary.Caption = MultiLanguages.GetString("tbl_Dictionary", "DictionaryOfSalary",
                navSalary.Caption);
            bbiPosition.Caption = MultiLanguages.GetString("tbl_Dictionary", "Position", bbiPosition.Caption);
            bbiProfessional.Caption = MultiLanguages.GetString("tbl_Dictionary", "Profesional",
                bbiProfessional.Caption);
            bbiDegree.Caption = MultiLanguages.GetString("tbl_Dictionary", "Degree", bbiDegree.Caption);
            bbiJob.Caption = MultiLanguages.GetString("tbl_Dictionary", "Job", bbiJob.Caption);
            bbiNationality.Caption = MultiLanguages.GetString("tbl_Dictionary", "Nationality",
                bbiNationality.Caption);
            bbiEthnic.Caption = MultiLanguages.GetString("tbl_Dictionary", "Ethnic", bbiEthnic.Caption);
            bbiReligion.Caption = MultiLanguages.GetString("tbl_Dictionary", "Religion", bbiReligion.Caption);
            bbiRelative.Caption = MultiLanguages.GetString("tbl_Dictionary", "FamilyRelationships",
                bbiRelative.Caption);
            bbiEducation.Caption = MultiLanguages.GetString("tbl_Dictionary", "Education", bbiEducation.Caption);
            bbiLanguage.Caption = MultiLanguages.GetString("tbl_Dictionary", "Language", bbiLanguage.Caption);
            bbiInformatic.Caption = MultiLanguages.GetString("tbl_Dictionary", "Informatic",
                bbiInformatic.Caption);
            bbiSkill.Caption = MultiLanguages.GetString("tbl_Dictionary", "Skills", bbiSkill.Caption);
            bbiBranch.Caption = MultiLanguages.GetString("tbl_Dictionary", "Branch", bbiBranch.Caption);
            bbiDepartment.Caption = MultiLanguages.GetString("tbl_Dictionary", "Department",
                bbiDepartment.Caption);
            bbiGroup.Caption = MultiLanguages.GetString("tbl_Dictionary", "Group", bbiGroup.Caption);
            bbiShift.Caption = MultiLanguages.GetString("tbl_Dictionary", "Shift", bbiShift.Caption);
            bbiSymbol.Caption = MultiLanguages.GetString("tbl_Dictionary", "Symbol", bbiSymbol.Caption);
            bbiMachine.Caption = MultiLanguages.GetString("tbl_Dictionary", "Machine", bbiMachine.Caption);
            bbiRank.Caption = MultiLanguages.GetString("tbl_Dictionary", "Rank", bbiRank.Caption);
            bbiStep.Caption = MultiLanguages.GetString("tbl_Dictionary", "Step", bbiStep.Caption);
            bbiAllowance.Caption = MultiLanguages.GetString("tbl_Dictionary", "Allowance", bbiAllowance.Caption);
        }

        private static string LoadStyle()
        {
            var set = new DataSet();
            set.ReadXml(Application.StartupPath + @"\Layout\Theme.xml");
            return set.Tables[0].Rows[0][1].ToString();
        }

        public void SetStyle(string Style)
        {
            if (Style == "Classic")
            {
               navBarControl1.SmallImages = imgClassic;
            }
            else
            {
                navBarControl1.SmallImages= imgMetro;
            }
        }

        private void xfmDictionary_Load(object sender, EventArgs e)
        {
            SetStyle(LoadStyle());
            Execute("xucPosition", "");
        }

        private void xfmDictionary_Load_1(object sender, EventArgs e)
        {
        }
    }
}